﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Seagull
{
    public interface IRepository<TEntity> : IQueryRepository<TEntity> where TEntity : class, new()
    {
        /// <summary>
        /// 创建一个新的资源,并返回创建的ID。
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        ulong Insert(TEntity data);

        /// <summary>
        /// 保存变更
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        void SaveChanges(TEntity data);

        /// <summary>
        /// 删除资源
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        void Delete(ulong id);
    }
}
